package com.sam.a_annotation;

import com.sam.bean.User;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {

    @Test
    public void fun1(){
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("com/sam/a_annotation/applicationContext.xml");
        User user = (User) applicationContext.getBean("user");
        User user1 = (User) applicationContext.getBean("user");
        System.out.println(user == user1);
        System.out.println(user.toString());
        applicationContext.close();
    }

}
